package com.qys.livesMall.shop.controller.app;

import com.qys.livesMall.common.result.R;
import com.qys.livesMall.framework.utils.SecurityUtils;
import com.qys.livesMall.shop.modal.entity.ShopPurchaseAccount;
import com.qys.livesMall.shop.service.ShopPurchaseAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 采购额度账户 前端控制器
 * </p>
 *
 * @author
 * @since 2023-09-15
 */
@RestController
@RequestMapping("/app/shop/purchase/account")
public class AppShopPurchaseAccountController {

    @Autowired
    private ShopPurchaseAccountService purchaseAccountService;

    @GetMapping("/get")
    public R<ShopPurchaseAccount> getByUserId(){
        return R.ok(purchaseAccountService.getByUserId(SecurityUtils.getUserId()));
    }
}
